package com.tedu.api.thread;

public class RunableAPI {
    public static void main(String[] args) {
        //创建 实现线程 对象
        Myrunable1 mr1=new Myrunable1();
        //创建Thread对象---启动线程方法
        Thread t1=new Thread(mr1);
        t1.start();

        //练习：重复一次
        Myrunable2 mr2=new Myrunable2();
        Thread t2=new Thread(mr2);
        t2.start();
    }
}
class Myrunable1 implements Runnable{
    public void run() {
         for (int i=0;i<1000;i++){
             System.out.println("王");

         }
    }
}
class Myrunable2 implements Runnable{
    public void run(){
        for (int i=0;i<1000;i++){
            System.out.println("培");
        }
    }
}